package com.party.core.service.analysis.impl;

import com.party.common.paging.Page;
import com.party.core.dao.read.analysis.StatisticsMobileEventFlowReadDao;
import com.party.core.dao.write.analysis.StatisticsMobileEventFlowWriteDao;
import com.party.core.model.BaseModel;
import com.party.core.model.analysis.StatisticsMobileEventFlow;
import com.party.core.service.analysis.IStatisticsMobileEventFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @program: party-temp
 * @description: 手机端事件流程接口实现
 * @author: yuguangqing
 * @create: 2018-08-01 11:57
 **/

@Service
public class StatisticsMobileEventFlowService implements IStatisticsMobileEventFlowService {

    @Autowired
    private StatisticsMobileEventFlowReadDao statisticsMobileEventFlowReadDao;
    @Autowired
    private StatisticsMobileEventFlowWriteDao statisticsMobileEventFlowWriteDao;

    @Override
    public String insert(StatisticsMobileEventFlow statisticsMobileEventFlow) {
        BaseModel.preInsert(statisticsMobileEventFlow);
        boolean result = statisticsMobileEventFlowWriteDao.insert(statisticsMobileEventFlow);
        if (result) {
            return statisticsMobileEventFlow.getId();
        }
        return null;
    }

    @Override
    public boolean update(StatisticsMobileEventFlow statisticsMobileEventFlow) {
        statisticsMobileEventFlow.setUpdateDate(new Date());
        return statisticsMobileEventFlowWriteDao.update(statisticsMobileEventFlow);
    }

    @Override
    public boolean deleteLogic(String id) {
        return statisticsMobileEventFlowWriteDao.deleteLogic(id);
    }

    @Override
    public boolean delete(String id) {
        return statisticsMobileEventFlowWriteDao.delete(id);
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return statisticsMobileEventFlowWriteDao.batchDeleteLogic(ids);
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return statisticsMobileEventFlowWriteDao.batchDelete(ids);
    }

    @Override
    public StatisticsMobileEventFlow get(String id) {
        return statisticsMobileEventFlowReadDao.get(id);
    }

    @Override
    public List<StatisticsMobileEventFlow> listPage(StatisticsMobileEventFlow statisticsMobileEventFlow, Page page) {
        return statisticsMobileEventFlowReadDao.listPage(statisticsMobileEventFlow, page);
    }

    @Override
    public List<StatisticsMobileEventFlow> list(StatisticsMobileEventFlow statisticsMobileEventFlow) {
        return null;
    }

    @Override
    public List<StatisticsMobileEventFlow> batchList(Set<String> ids, StatisticsMobileEventFlow statisticsMobileEventFlow, Page page) {
        return null;
    }

    @Override
    public List<StatisticsMobileEventFlow> getByUniqueCode(String uniqueCode) {
        return statisticsMobileEventFlowReadDao.getByUniqueCode(uniqueCode);
    }

    @Override
    public List<StatisticsMobileEventFlow> findByEventId(String eventId, Map<String, Object> params) {
        return statisticsMobileEventFlowReadDao.findByEventId(eventId, params);

    }

    @Override
    public StatisticsMobileEventFlow getNewFlow(String uniqueCode) {
        return statisticsMobileEventFlowReadDao.getNewFlow(uniqueCode);
    }
}
